
require("https://cdn.bootcss.com/Swiper/4.1.6/css/swiper.css");
var Swiper = require("https://cdn.bootcss.com/Swiper/4.1.6/js/swiper.js");

//全局指令
Vue.directive('swiper', {
    //监控数据变化 
    mounted(el, binding) {
        var mySwiper = new Swiper('.swiper-container', {
            direction: 'vertical',
            loop: true,

            // 如果需要分页器
            pagination: {
                el: '.swiper-pagination',
            },

            // 如果需要前进后退按钮
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            }
        })
    }
});